package cn.jaye.fabric.common.constants.mapping;

/**
 * @author Jaye
 * @create 2018-05-11 11:00
 */
public class Table {
    public enum Org {
        orgId("org_id"),
        mspId("msp_id"),
        domainName("domain_name"),
        orgName("org_name"),
        tlsFlag("tls_flag"),
        caLocation("ca_location");

        Org(String fieldValue) {
            this.fieldValue = fieldValue;
        }

        private String fieldValue;

        public String getFieldValue() {
            return fieldValue;
        }
    }

    public enum Orderer {
        orgId("org_id"),
        orderId("order_id"),
        orderName("order_name"),
        hostAddress("host_address"),
        tlsFlag("tls_flag"),
        port("port");

        Orderer(String fieldValue) {
            this.fieldValue = fieldValue;
        }

        private String fieldValue;

        public String getFieldValue() {
            return fieldValue;
        }
    }

    public enum Peer {
        orgId("org_id"),
        orderId("order_id"),
        peerId("peer_id"),
        peerName("peer_name"),
        hostAddress("host_address"),
        tlsFlag("tls_flag"),
        eventPort("event_port"),
        port("port");

        Peer(String fieldValue) {
            this.fieldValue = fieldValue;
        }

        private String fieldValue;

        public String getFieldValue() {
            return fieldValue;
        }
    }

    public enum ChainCode {
        chaincodeId("chaincode_id"),
        name("name"),
        version("version"),
        path("path"),
        channelName("channel_name"),
        txCount("tx_count");

        ChainCode(String fieldValue) {
            this.fieldValue = fieldValue;
        }

        private String fieldValue;

        public String getFieldValue() {
            return fieldValue;
        }
    }

    public enum Transaction {
        txHash("tx_hash"),
        channelName("channel_name"),
        blockId("block_id"),
        createTime("create_time"),
        chainCodeId("chaincode_id");

        Transaction(String fieldValue) {
            this.fieldValue = fieldValue;
        }

        private String fieldValue;

        public String getFieldValue() {
            return fieldValue;
        }
    }

    public enum Block {
        blockNum("block_num"),
        channelName("channel_name"),
        dataHash("data_hash"),
        preHash("pre_hash"),
        txCount("tx_count");

        Block(String fieldValue) {
            this.fieldValue = fieldValue;
        }

        private String fieldValue;

        public String getFieldValue() {
            return fieldValue;
        }
    }
}
